 
 
 Nicht funktionierender Code aus TUGLabyrtinth
 
 
  // BEGIN OF LOAD RULES BUTTON  *********************************************
        /*load_rules_button_.setBounds(94,5,89,28);
        load_rules_button_.setBackground(new Color(127,127,127));
        load_rules_button_.setForeground(Color.ORANGE);
        load_rules_button_.setText("Load");

        load_rules_button_.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) { // Load rules button pressed
                
                String filename;
/*              FileOpenService fos = null;
                FileContents fileContents = null;
                
                try {
                    fos = (FileOpenService)ServiceManager.
                              lookup("javax.jnlp.FileOpenService"); 
                } catch (UnavailableServiceException exc) { }

                if (fos != null) {
                    try {
                        fileContents = fos.openFileDialog(null, null); 
                    } catch (Exception exc) {
                        System.err.println("Open command failed: "
                                   + exc.getLocalizedMessage());
                    }
                }

                if (fileContents != null) {
                    try {
                        //This is where a real application would do something
                        //with the file.
                        filename = fileContents.getName();
                        
                        LoadInstructions rules_loader = 
                            new LoadInstructions(filename, mainframe_.getDocumentBase());
                        instruct_list_ = rules_loader.getInstructionList();
                        
                        TUGLabyrinth.this.rule_tree_panel_.deleteAllRules();
                        
                        for (int i = 0; i < instruct_list_.size(); i++) {
                          Instruction dummy = instruct_list_.getInstructionAtPos(i);
                          TUGLabyrinth.this.rule_tree_panel_.addNewRule(dummy);
                        }
                    } catch (IOException exc) {
                        System.err.println("Problem opening file: "
                                   + exc.getLocalizedMessage());
                    }
                }*/
                
                
               /* JFileChooser chooser = new JFileChooser();
                int returnVal = chooser.showOpenDialog(null);
                if(returnVal == JFileChooser.APPROVE_OPTION) {
                   filename = chooser.getSelectedFile().getPath();
                   LoadInstructions rules_loader = 
                       new LoadInstructions(filename, mainframe_.getDocumentBase());
                   instruct_list_ = rules_loader.getInstructionList();
                   
                   TUGLabyrinth.this.rule_tree_panel_.deleteAllRules();
                   
                   for (int i = 0; i < instruct_list_.size(); i++) {
                      Instruction dummy = instruct_list_.getInstructionAtPos(i);
                      TUGLabyrinth.this.rule_tree_panel_.addNewRule(dummy);
                    }
                }
            }
        });*/
        // END OF LOAD RULES BUTTON ************************************************
        
        
// BEGIN OF SAVE RULES BUTTON  *********************************************
       /* save_rules_button_.setBounds(183,5,89,28);
        save_rules_button_.setBackground(new Color(127,127,127));
        save_rules_button_.setForeground(Color.ORANGE);
        save_rules_button_.setText("Save");

        save_rules_button_.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) { // Load rules button pressed
                
                String filename, folder;
                JFileChooser chooser = new JFileChooser();
                int returnVal = chooser.showSaveDialog(null);
                if(returnVal == JFileChooser.APPROVE_OPTION) {
                  instruct_list_ = new InstructionList();
                    LinkedList listi = TUGLabyrinth.this.rule_tree_panel_
                            .getRuleList();
                   
                    for (int i = 0; i < listi.size(); i++) {
                      Instruction dummy = ((ConditionRulePanel) listi.get(i)).getInstruction();
                      instruct_list_.addInstruction(dummy);
                    System.out.print(dummy);
                    }
                    
                    filename = chooser.getSelectedFile().getPath();
                    folder = chooser.getSelectedFile().getParent();
                    WriteInstructionsToXML rules_saver =
                       new WriteInstructionsToXML(instruct_list_);
                    rules_saver.writeXMLFile(filename);
                    
                    rules_saver.writeDTDFile(folder);
                }
            }
        });*/
        // END OF SAVE RULES BUTTON **************************************************
        
        
    // LOAD LAB BUTTON ******************************************************************
    {
      load_lab_button_.setBounds(710, 270, 150, 30);
      load_lab_button_.setBackground(new Color(127,127,127));
      load_lab_button_.setForeground(Color.ORANGE);
      load_lab_button_.setText("Labyrinth laden");
      load_lab_button_.addActionListener
      (new java.awt.event.ActionListener() 
        {public void actionPerformed(java.awt.event.ActionEvent evt) 
          {
                    String filename;
                    JFileChooser chooser = new JFileChooser();
                    int returnVal = chooser.showOpenDialog(null);
                    if(returnVal == JFileChooser.APPROVE_OPTION) {
                        filename = chooser.getSelectedFile().getPath();
                        custom_level_filename_ = filename;
                      lab_choose_panel_.setSelected(LabyrinthChoosePanel.CUSTOM_LEVEL_TYPE);
              drawNewLabyrinth();
                    }
          }
        }
      );
    }
    // END LOAD LAB BUTTON ****************************************************

    // SAVE LAB BUTTON ********************************************************
    {
      save_lab_button_.setBounds(710, 310, 150, 30);
      save_lab_button_.setBackground(new Color(127,127,127));
      save_lab_button_.setForeground(Color.ORANGE);
      save_lab_button_.setText("Labyrinth speichern");
      save_lab_button_.addActionListener
      (new java.awt.event.ActionListener() 
        {public void actionPerformed(java.awt.event.ActionEvent evt) 
          {
                    String filename, folder;
                    JFileChooser chooser = new JFileChooser();
                    int returnVal = chooser.showSaveDialog(null);
                    if(returnVal == JFileChooser.APPROVE_OPTION) {
                        filename = chooser.getSelectedFile().getPath();
                        folder = chooser.getSelectedFile().getParent();
                        WriteLabToXML lab_writer = new WriteLabToXML(labyrinth_field_);
                        lab_writer.writeXMLFile(filename);
                        lab_writer.writeDTDFile(folder);
                    }
          }
        }
      );
    }
    // END SAVE LAB BUTTON ****************************************************
